/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.stop.risk.base.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.stop.common.constant.enums.ParkStopSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.SysDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 因子信息
 *
 * @author pig
 * @date 2024-02-20 14:22:40
 */
@Data
@TableName("line_poll_factor_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "因子信息")
public class LinePollFactorInfoEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * id
     */
    @Schema(description = "id")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 名称
     */
    @Schema(description = "名称")
    private String name;

    /**
     * 编码
     */
    @Schema(description = "编码")
    private String code;

    /**
     * 缩略名
     */
    @Schema(description = "缩略名")
    private String shortName;

    /**
     * 计量单位
     */
    @Schema(description = "计量单位")
    private Long unitId;

    /**
     * 是否有统计单位
     */
    @Schema(description = "是否有统计单位")
    private String isHaveStatistic;

    /**
     * 统计单位
     */
    @Schema(description = "统计单位")
    private Long statisticUnitId;

    /**
     * 因子类型
     */
    @Schema(description = "因子类型")
    private Integer factorType;

    /**
     * 是否启用
     */
    @Schema(description = "是否启用")
    private Boolean useFlag;

    /**
     * 序号
     */
    @Schema(description = "序号")
    private Integer sortNum;

    /**
     * 原编码
     */
    @Schema(description = "原编码")
    private String oldCode;

    /**
     * 是否有折算值
     */
    @Schema(description = "是否有折算值")
    private String isHaveZs;

    /**
     * 是否参与修约
     */
    @Schema(description = "是否参与修约")
    private String isRepair;

    /**
     * 是否有排放量
     */
    @Schema(description = "是否有排放量")
    private String isHaveDischarge;

    /**
     * 因子特征
     */
    @Schema(description = "因子特征")
    private String factorFeature;

    public String getFactorTypeStr() {
        return DictResolver.getItemLabelByValue(ParkStopSysDictEnum.monitor_factor_type, this.factorType);

    }

    public String getUnitIdStr() {
        return DictResolver.getItemLabelByValue(ParkStopSysDictEnum.measure_unit, this.unitId);
    }

    public String getUseFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.useFlag);
    }

}
